home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 51 / 051.d81 / text printer (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  3KB  |  94 lines

  1. 0 ifa=.thena=1:load"tp.disk.o",8,1
  2. 1 ifa=1thena=2:load"tp.print1.o",8,1
  3. 2 ifa=2thena=3:load"tp.print2.o",8,1
  4. 3 goto110
  5. 5 :
  6. 6 rem       alter rom scrolling
  7. 7 :
  8. 10 poke770,131:poke771,164:poke88,.:poke89,192:poke90,.:poke91,192
  9. 20 poke781,33:poke782,.:sys41964:poke88,254:poke89,255:poke90,254:poke91,255
  10. 30 poke781,33:poke782,.:sys41964:poke59639,5:poke1,53
  11. 40 return
  12. 100 :
  13. 105 rem       setup stuff...
  14. 106 :
  15. 110 poke55,.:poke56,32:clr:q$=chr$(34)
  16. 120 dim fi$(144),ft%(144),nb%(144)
  17. 122 ft$(0)="":ft$(1)=",s":ft$(2)=",p":fl=0
  18. 125 gosub1000:gosub10
  19. 130 print"[147]      [154][201]nsert disk and press [211][208][193][195][197]":poke198,.
  20. 140 ifpeek(203)<>60then140
  21. 160 print"[147] [154][210]eading all "q$"[208][210][199]"q$" [154]files w / "q$"[212]."q$" [154]names"
  22. 170 print"  [154][208]ress [193] [154]to abort while printing text."
  23. 180 :
  24. 185 rem      read the directory
  25. 190 :
  26. 200 open15,8,15,"i0":open8,8,8,"#"
  27. 210 print#15,"u1:"8;0;18;1
  28. 220 sys49152,fi$,ft%,nb%
  29. 230 if (left$(fi$,2)<>"t.") or (ft%<>130) then ok=.:goto240
  30. 235 co=co+1:fi$(co)=fi$:ft%(co)=ft%:nb%(co)=nb%:ok=1
  31. 240 if(ok)thenprint"";fi$
  32. 250 a=peek(2):ifa=.then220
  33. 260 ifa<>255thenprint#15,"u1:"8;0;18;a:print#15,"b-p:"8;0:goto220
  34. 270 close8:close15
  35. 280 :
  36. 285 :
  37. 290 rem    print those files!!
  38. 295 :
  39. 300 print:for a=1 to co
  40. 305 print"[154][210]eading: "fi$(a)
  41. 306 iffi$(a)<>""then310
  42. 307 print"[154] [212]here are no "q$"t."q$"[154] files on this disk."
  43. 308 goto2000
  44. 310 sys 49155,8192,fi$(a)
  45. 315 ea=(peek(781)+peek(782)*256):           poke ea,.:pokeea+1,13:poke ea+2,13
  46. 320 open4,4,7:z=.:a$=""
  47. 321 ifpeek(8192+z)=13then323
  48. 322 a$=a$+chr$(peek(8192+z)):z=z+1:goto321
  49. 323 s=8192:ifleft$(a$,3)="^u:"thens=8192+len(a$)+1
  50. 325 print"[154][145][208]rinting: "fi$(a):poke2,.
  51. 330 if(fl)then sys 52224,s:sp=59-peek(787)
  52. 340 iffl=0then sys 51200,s:sp=peek(787)+5
  53. 345 ifpeek(2)=0then360
  54. 346 sys65484:print"[145][150]  [193]re you sure you want to quit? ([217][150]/[206][150])":poke198,.
  55. 347 geta$:ifa$<>"y"anda$<>"n"then347
  56. 348 ifa$="y"thena=co-1:run1
  57. 349 print"[145]                                      "
  58. 350 print"[145][154][208]rinting: "fi$(a):poke2,.
  59. 351 if(fl)thenpoke781,4:sys65481:           sys52486:sp=59-peek(787)
  60. 352 iffl=0thenpoke781,4:sys65481:           sys51318:sp=peek(787)+5
  61. 354 ifpeek(2)=1then346
  62. 360 for b=1 to sp:print#4:next:close4
  63. 365 print"[145][154][198]inished printing: "fi$(a)
  64. 370 next:run1
  65. 1000 poke53281,0:poke53280,0
  66. 1010 print"[147][159]"
  67. 1020 print"         [204][207][193][196][211][212][193][210]'[211] [212][197][216][212] [208][210][201][206][212][197][210]
  68. 1030 [153]"cont             by (NULL)ike (NULL)aynard
  69. 1040 print"[158]    [212]his program will print out all of"
  70. 1050 print" the files on the disk that start with"
  71. 1060 print" the prefix "q$"t."q$".  [212]hese are the"
  72. 1070 print" files that are shown on the screen"
  73. 1080 print" when you choose '[210]un [201]t' from the"
  74. 1090 print" small yellow menu."
  75. 1092 print"    [205]ake sure your printer is on-line"
  76. 1094 print" and the print head is set to the top"
  77. 1096 print" of a page."
  78. 1100 print"       [159]([212][159])wo columns"
  79. 1110 print"       [159]([211][159])ingle column in mid-page"
  80. 1120 print"       [159]([210][159])eturn to [204][207][193][196][211][212][193][210]"
  81. 1130 print"          [154][208]ress  [212][154], [211] or [210]"
  82. 1140 geta$:ifa$<>"t"anda$<>"s"anda$<>"r"then1140
  83. 1145 ifa$="r"thenprint"[147]":goto2000
  84. 1150 fl=0:ifa$="t"thenfl=1
  85. 1160 return
  86. 2000 print"         [196]o you want to return"
  87. 2005 print"          to [204][207][193][196][211][212][193][210]?  (y[154]/n[154])"
  88. 2010 poke198,.
  89. 2020 geta$:ifa$<>"y"anda$<>"n"then2020
  90. 2030 ifa$="n"thenrun1
  91. 2040 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  92. 2050 ifer<>63thenend
  93. 2060 poke1,119:load"hello connect",8
  94.